package org.southyin.test;

public class Practice01 {
    public static void main(String[] args) {
        // 写一个方法：判断一个字符串中，某字符出现的所有位置
        String str = "abcdabcdeabc";
        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) == 'a') {
                count++;
            }
        }
        int count1 = 0;
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] == 'a') {
                count1++;
            }
        }
    }
}
